package com.fin.zw.aiqas.entity;

import com.fin.zw.aiqas.enums.*;
import lombok.Data;
import org.hibernate.annotations.Table;

import javax.persistence.*;

@Entity
@Table(appliesTo = "formula_info", comment = "关键字匹配质检点")
@Data
public class FormulaInfo extends BaseEntity {

    @Column(columnDefinition = "varchar(100) COMMENT '质检点名称'")
    private String name;

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = "varchar(100) COMMENT '使用范围'")
    private UseRange matchRange;

    @Column(columnDefinition = "varchar(20) COMMENT '范围类型'")
    @Enumerated(EnumType.STRING)
    private MatchRange matchType;

    @Column(columnDefinition = "varchar(20) COMMENT '是否选中'")
    @Enumerated(EnumType.STRING)
    private Whether selected;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "formula_scenes_id", columnDefinition = "bigint(64) COMMENT '质检点的应用场景'")
    private ScenesInfo scenesInfo;

    @Column(columnDefinition = "varchar(20) COMMENT '质检点类型'")
    @Enumerated(EnumType.STRING)
    private FormulaType formulaType;

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = "varchar(20) COMMENT '是否已经同步'")
    private Synchronization isSynchronize = Synchronization.NO;

    @Column(columnDefinition = "varchar(100) COMMENT '质检点编码'")
    private String formulaCode;

    @Column(columnDefinition = "varchar(100) COMMENT '备注'")
    private String content;

}

